package com.story.story_serve.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.story.story_pojo.userinfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * ClassName:  UserMapper
 * description:
 *
 * @ author:郭海龙
 * @ Create：2024/4/30 15:07
 * @ Version:1.0
 */
@Mapper            // mybatis框架中用于标识dao层的注释，自动生成该接口的实现类对象，并放入spring容器进行管理
public interface UserMapper extends BaseMapper<userinfo>{

    // 删除用户
    @Delete("delete from userinfo where username = #{username}")
    int delById(userinfo user);

    // 修改个人数据
    @Update("update userinfo set username = #{username}, nikename = #{nikename}, userpassword = #{userpassword}, email = #{email}, phone = #{phone}, address = " +
            "#{address}, gender = #{gender}, userimg = #{userimg1} ")
    int updatebyId(userinfo userinfo, String username1);
}
